/**********************************************************/
/* Goblin Defense - A tower defense game for Wii Homebrew */
/* Copyright (C) 2009 Ricardo Bueno Cordeiro              */
/* Licensed under de GNU General Public License v2.0      */
/*   See license_gplv2.txt for detalis                    */
/**********************************************************/

#ifndef __NETWORK_H_
#define __NETWORK_H_

#include <gccore.h>

class Lock {
private:
	mutex_t &mutex;
	s32 mutex_status;
public:
	Lock(mutex_t &m, s32 ms) : mutex(m), mutex_status(ms) { if (ms >= 0) LWP_MutexLock(mutex); };
	~Lock() { if (mutex_status >= 0) LWP_MutexUnlock(mutex); }
};

void init_network();
void close_network();
s32 start_network();

#endif
